from .models import *
from rest_framework import serializers


class As_manage_Serializer(serializers.ModelSerializer):
    class Meta:
        model = FineAs
        fields = [
            "station",
            "count_good",
            "count_reject",
            "ftq",
            "cycletime",
            "eun",
            "lastcycle",
            "maxcycle",
            "mincycle",
            "overcycle",
            "overcycle_positive_three",
            "overcycle_negative_three",
            "pano",
            "time",
        ]


class OutputLoopa_Serializer(serializers.ModelSerializer):
    class Meta:
        model = OutputLoopa
        fields = [
            "eun",
            "station",
            "pano",
            "last_cycle_time",
            "current_cycle_time",
            "goodpiececount",
            "rejectpiececount",
            "time",
        ]


class AsCycle_Serializer(serializers.ModelSerializer):
    class Meta:
        model = AsCycle
        fields = [
            "cycle",
            "time",
        ]


class toolChangeDataSerializer(serializers.ModelSerializer):
    class Meta:
        model = ToolChange
        fields = [
            "id",
            "op",
            "tool_number",
            "max_life_new",
            "max_life_old",
            "actual_life_new",
            "actual_life_old",
            "rest_life_new",
            "rest_life_old",
            "block_number_new",
            "block_number_old",
            "changetime",
            "createdate",
            "reason",
            "life_stat",
            "createby",
            "changetype",
            "tool_pot",
        ]
